package com.rjpacket.supernews.app.fragments;

import android.content.Intent;
import android.os.Bundle;

import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import android.widget.ImageView;
import com.rjpacket.supernews.app.R;
import com.rjpacket.supernews.app.RecycleViewActivity;


public class ImageFragment extends Fragment implements View.OnClickListener {
    public ImageFragment() {
    }

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) {

        View view = inflater.inflate(R.layout.fragment_image, container, false);
        ImageView imageView = (ImageView) view.findViewById(R.id.image_meinv);
        imageView.setOnClickListener(this);
        ImageView imageView1 = (ImageView) view.findViewById(R.id.image_luoli);
        imageView1.setOnClickListener(this);
        ImageView imageView2 = (ImageView) view.findViewById(R.id.image_qingchu);
        imageView2.setOnClickListener(this);
        ImageView imageView3 = (ImageView) view.findViewById(R.id.image_mingxing);
        imageView3.setOnClickListener(this);
        ImageView imageView4 = (ImageView) view.findViewById(R.id.image_xinggan);
        imageView4.setOnClickListener(this);
        ImageView imageView5 = (ImageView) view.findViewById(R.id.image_xionghaizi);
        imageView5.setOnClickListener(this);
        ImageView imageView6 = (ImageView) view.findViewById(R.id.image_leiren);
        imageView6.setOnClickListener(this);
        ImageView imageView7 = (ImageView) view.findViewById(R.id.image_gaoxiao);
        imageView7.setOnClickListener(this);
        ImageView imageView8 = (ImageView) view.findViewById(R.id.image_manhua);
        imageView8.setOnClickListener(this);
        ImageView imageView9 = (ImageView) view.findViewById(R.id.image_gaoxiaogif);
        imageView9.setOnClickListener(this);
        ImageView imageView10 = (ImageView) view.findViewById(R.id.image_shoujibizhi);
        imageView10.setOnClickListener(this);
        ImageView imageView11 = (ImageView) view.findViewById(R.id.image_fenjing);
        imageView11.setOnClickListener(this);
        ImageView imageView12 = (ImageView) view.findViewById(R.id.image_chuangyi);
        imageView12.setOnClickListener(this);
        ImageView imageView13 = (ImageView) view.findViewById(R.id.image_dongman);
        imageView13.setOnClickListener(this);
        ImageView imageView14 = (ImageView) view.findViewById(R.id.image_kuche);
        imageView14.setOnClickListener(this);

        return view;
    }

    @Override
    public void onClick(View view) {
        switch (view.getId()) {
            case R.id.image_meinv:
                Intent intent = new Intent(getActivity(), RecycleViewActivity.class);
                intent.putExtra("url", "meinv");
                startActivity(intent);
                break;
            case R.id.image_luoli:
                Intent intent1 = new Intent(getActivity(), RecycleViewActivity.class);
                intent1.putExtra("url", "luoli");
                startActivity(intent1);
                break;
            case R.id.image_qingchu:
                Intent intent2 = new Intent(getActivity(), RecycleViewActivity.class);
                intent2.putExtra("url", "qingchu");
                startActivity(intent2);
                break;
            case R.id.image_mingxing:
                Intent intent3 = new Intent(getActivity(), RecycleViewActivity.class);
                intent3.putExtra("url", "mingxing");
                startActivity(intent3);
                break;
            case R.id.image_xinggan:
                Intent intent4 = new Intent(getActivity(), RecycleViewActivity.class);
                intent4.putExtra("url", "xinggan");
                startActivity(intent4);
                break;
            case R.id.image_xionghaizi:
                Intent intent5 = new Intent(getActivity(), RecycleViewActivity.class);
                intent5.putExtra("url", "xionghaizi");
                startActivity(intent5);
                break;
            case R.id.image_leiren:
                Intent intent6 = new Intent(getActivity(), RecycleViewActivity.class);
                intent6.putExtra("url", "leiren");
                startActivity(intent6);
                break;
            case R.id.image_gaoxiao:
                Intent intent7 = new Intent(getActivity(), RecycleViewActivity.class);
                intent7.putExtra("url", "gaoxiao");
                startActivity(intent7);
                break;
            case R.id.image_manhua:
                Intent intent8 = new Intent(getActivity(), RecycleViewActivity.class);
                intent8.putExtra("url", "manhua");
                startActivity(intent8);
                break;
            case R.id.image_gaoxiaogif:
                Intent intent9 = new Intent(getActivity(), RecycleViewActivity.class);
                intent9.putExtra("url", "gaoxiaogif");
                startActivity(intent9);
                break;
            case R.id.image_shoujibizhi:
                Intent intent10 = new Intent(getActivity(), RecycleViewActivity.class);
                intent10.putExtra("url", "shoujibizhi");
                startActivity(intent10);
                break;
            case R.id.image_fenjing:
                Intent intent11 = new Intent(getActivity(), RecycleViewActivity.class);
                intent11.putExtra("url", "fengjing");
                startActivity(intent11);
                break;
            case R.id.image_chuangyi:
                Intent intent12 = new Intent(getActivity(), RecycleViewActivity.class);
                intent12.putExtra("url", "chuangyi");
                startActivity(intent12);
                break;
            case R.id.image_dongman:
                Intent intent13 = new Intent(getActivity(), RecycleViewActivity.class);
                intent13.putExtra("url", "dongman");
                startActivity(intent13);
                break;
            case R.id.image_kuche:
                Intent intent14 = new Intent(getActivity(), RecycleViewActivity.class);
                intent14.putExtra("url", "kuche");
                startActivity(intent14);
                break;
        }
    }
}
